export default {
    data() {
        return {
            tableData: [],
            totalPage: 0,
            currentPage: 1,
            loading: false,
        }
    },
    methods: {
        async getList() {
            this.loading = true
            let ret1 = await this.pageCount(this.params)
            this.totalPage = ret1.data
            if (ret1.code === 0) {
                let ret2 = await this.page(this.params, this.currentPage)
                this.tableData = ret2.data
            }
            this.loading = false
        },
        search() {
            this.currentPage = 1
            this.getList()
        },
        handleCurrentChange(val) {
            this.currentPage = val
            this.getList()
        },
    },
    mounted() {
        this.getList()
    }
}